﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Bank_database_system
{
    public partial class 登录界面 : Form
    {
        public 登录界面()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void pictureBox3_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            int i = AccountCheck.staffCheck(textBox2.Text, textBox1.Text);
            if (i == -1)
            {
                MessageBox.Show("账号或密码错误");
            }
            else if (i == 0)
            {
                MessageBox.Show("帐号状态异常，请联系信息技术部解决");
            }
            else if (i == 3)//跳转到信息部门
            {
                DialogResult = DialogResult.OK;
                this.Close();
            }
            else if (i == 1)//跳转到人事部门
            {
                DialogResult = DialogResult.Yes;
                this.Close();
            }
            else if (i == 2)//跳转到财务部门
            {
                DialogResult = DialogResult.No;
                this.Close();
            }
            else if (i == 4)//跳转到业务部门
            {
                DialogResult = DialogResult.Continue;
                this.Close();
            }
            else
            {
                MessageBox.Show("出现未知错误");
            }

        }
        private void button1_mouse_enter(object sender, EventArgs e)
        {
            // 鼠标悬停时更改图片
            button1.Image = Properties.Resources.登入悬停;
        }

        private void button1_mouse_leave(object sender, EventArgs e)
        {
            // 鼠标悬停时更改图片
            button1.Image = Properties.Resources.登入;
        }
        private void 登录界面_Load(object sender, EventArgs e)
        {

        }
    }
}
